Optimal. Leaf size=226 \[ \frac {2 b^2 d n^2 x (f x)^{-1+m}}{m^3}+\frac {b^2 e n^2 x^{1+m} (f x)^{-1+m}}{4 m^3}+\frac {b^2 d^2 n^2 x^{1-m} (f x)^{-1+m} \log ^2(x)}{2 e m}-\frac {2 b d n x (f x)^{-1+m} \left (a+b \log \left (c x^n\right )\right )}{m^2}-\frac {b e n x^{1+m} (f x)^{-1+m} \left (a+b \log \left (c x^n\right )\right )}{2 m^2}-\frac {b d^2 n x^{1-m} (f x)^{-1+m} \log (x) \left (a+b \log \left (c x^n\right )\right )}{e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 226, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 8, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {2377, 2376,
272, 45, 2372, 12, 14, 2338} \begin {gather*} -\frac {b d^2 n x^{1-m} \log (x) (f x)^{m-1} \left (a+b \log \left (c x^n\right )\right )}{e m}+\frac {x^{1-m} (f x)^{m-1} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}-\frac {2 b d n x (f x)^{m-1} \left (a+b \log \left (c x^n\right )\right )}{m^2}-\frac {b e n x^{m+1} (f x)^{m-1} \left (a+b \log \left (c x^n\right )\right )}{2 m^2}+\frac {b^2 d^2 n^2 x^{1-m} \log ^2(x) (f x)^{m-1}}{2 e m}+\frac {2 b^2 d n^2 x (f x)^{m-1}}{m^3}+\frac {b^2 e n^2 x^{m+1} (f x)^{m-1}}{4 m^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 14
Rule 45
Rule 272
Rule 2338
Rule 2372
Rule 2376
Rule 2377
Rubi steps
\begin {align*} \int (f x)^{-1+m} \left (d+e x^m\right ) \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\left (x^{1-m} (f x)^{-1+m}\right ) \int x^{-1+m} \left (d+e x^m\right ) \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}-\frac {\left (b n x^{1-m} (f x)^{-1+m}\right ) \int \frac {\left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x} \, dx}{e m}\\ &=-\frac {b n x^{1-m} (f x)^{-1+m} \left (\frac {4 d e x^m}{m}+\frac {e^2 x^{2 m}}{m}+2 d^2 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{2 e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}+\frac {\left (b^2 n^2 x^{1-m} (f x)^{-1+m}\right ) \int \frac {e x^m \left (4 d+e x^m\right )+2 d^2 m \log (x)}{2 m x} \, dx}{e m}\\ &=-\frac {b n x^{1-m} (f x)^{-1+m} \left (\frac {4 d e x^m}{m}+\frac {e^2 x^{2 m}}{m}+2 d^2 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{2 e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}+\frac {\left (b^2 n^2 x^{1-m} (f x)^{-1+m}\right ) \int \frac {e x^m \left (4 d+e x^m\right )+2 d^2 m \log (x)}{x} \, dx}{2 e m^2}\\ &=-\frac {b n x^{1-m} (f x)^{-1+m} \left (\frac {4 d e x^m}{m}+\frac {e^2 x^{2 m}}{m}+2 d^2 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{2 e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}+\frac {\left (b^2 n^2 x^{1-m} (f x)^{-1+m}\right ) \int \left (4 d e x^{-1+m}+e^2 x^{-1+2 m}+\frac {2 d^2 m \log (x)}{x}\right ) \, dx}{2 e m^2}\\ &=\frac {2 b^2 d n^2 x (f x)^{-1+m}}{m^3}+\frac {b^2 e n^2 x^{1+m} (f x)^{-1+m}}{4 m^3}-\frac {b n x^{1-m} (f x)^{-1+m} \left (\frac {4 d e x^m}{m}+\frac {e^2 x^{2 m}}{m}+2 d^2 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{2 e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}+\frac {\left (b^2 d^2 n^2 x^{1-m} (f x)^{-1+m}\right ) \int \frac {\log (x)}{x} \, dx}{e m}\\ &=\frac {2 b^2 d n^2 x (f x)^{-1+m}}{m^3}+\frac {b^2 e n^2 x^{1+m} (f x)^{-1+m}}{4 m^3}+\frac {b^2 d^2 n^2 x^{1-m} (f x)^{-1+m} \log ^2(x)}{2 e m}-\frac {b n x^{1-m} (f x)^{-1+m} \left (\frac {4 d e x^m}{m}+\frac {e^2 x^{2 m}}{m}+2 d^2 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{2 e m}+\frac {x^{1-m} (f x)^{-1+m} \left (d+e x^m\right )^2 \left (a+b \log \left (c x^n\right )\right )^2}{2 e m}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 125, normalized size = 0.55 \begin {gather*} \frac {(f x)^m \left (2 a^2 m^2 \left (2 d+e x^m\right )-2 a b m n \left (4 d+e x^m\right )+b^2 n^2 \left (8 d+e x^m\right )-2 b m \left (-2 a m \left (2 d+e x^m\right )+b n \left (4 d+e x^m\right )\right ) \log \left (c x^n\right )+2 b^2 m^2 \left (2 d+e x^m\right ) \log ^2\left (c x^n\right )\right )}{4 f m^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.19, size = 1919, normalized size = 8.49
method | result | size |
risch | \(\text {Expression too large to display}\) | \(1919\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 266, normalized size = 1.18 \begin {gather*} \frac {b^{2} f^{m - 1} e^{\left (2 \, m \log \left (x\right ) + 1\right )} \log \left (c x^{n}\right )^{2}}{2 \, m} - 2 \, {\left (\frac {f^{m - 1} n x^{m} \log \left (c x^{n}\right )}{m^{2}} - \frac {f^{m - 1} n^{2} x^{m}}{m^{3}}\right )} b^{2} d - \frac {2 \, a b d f^{m - 1} n x^{m}}{m^{2}} - \frac {1}{4} \, {\left (\frac {2 \, f^{m - 1} n x^{2 \, m} \log \left (c x^{n}\right )}{m^{2}} - \frac {f^{m - 1} n^{2} x^{2 \, m}}{m^{3}}\right )} b^{2} e + \frac {a b f^{m - 1} e^{\left (2 \, m \log \left (x\right ) + 1\right )} \log \left (c x^{n}\right )}{m} + \frac {\left (f x\right )^{m} b^{2} d \log \left (c x^{n}\right )^{2}}{f m} + \frac {a^{2} f^{m - 1} e^{\left (2 \, m \log \left (x\right ) + 1\right )}}{2 \, m} - \frac {a b f^{m - 1} n e^{\left (2 \, m \log \left (x\right ) + 1\right )}}{2 \, m^{2}} + \frac {2 \, \left (f x\right )^{m} a b d \log \left (c x^{n}\right )}{f m} + \frac {\left (f x\right )^{m} a^{2} d}{f m} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 250, normalized size = 1.11 \begin {gather*} \frac {{\left (2 \, b^{2} m^{2} n^{2} e \log \left (x\right )^{2} + 2 \, b^{2} m^{2} e \log \left (c\right )^{2} + 2 \, {\left (2 \, a b m^{2} - b^{2} m n\right )} e \log \left (c\right ) + {\left (2 \, a^{2} m^{2} - 2 \, a b m n + b^{2} n^{2}\right )} e + 2 \, {\left (2 \, b^{2} m^{2} n e \log \left (c\right ) + {\left (2 \, a b m^{2} n - b^{2} m n^{2}\right )} e\right )} \log \left (x\right )\right )} f^{m - 1} x^{2 \, m} + 4 \, {\left (b^{2} d m^{2} n^{2} \log \left (x\right )^{2} + b^{2} d m^{2} \log \left (c\right )^{2} + a^{2} d m^{2} - 2 \, a b d m n + 2 \, b^{2} d n^{2} + 2 \, {\left (a b d m^{2} - b^{2} d m n\right )} \log \left (c\right ) + 2 \, {\left (b^{2} d m^{2} n \log \left (c\right ) + a b d m^{2} n - b^{2} d m n^{2}\right )} \log \left (x\right )\right )} f^{m - 1} x^{m}}{4 \, m^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1535 vs.
\(2 (212) = 424\).
time = 47.98, size = 1535, normalized size = 6.79 \begin {gather*} \begin {cases} \tilde {\infty } \left (d + e\right ) \left (a^{2} x - 2 a b n x + 2 a b x \log {\left (c x^{n} \right )} + 2 b^{2} n^{2} x - 2 b^{2} n x \log {\left (c x^{n} \right )} + b^{2} x \log {\left (c x^{n} \right )}^{2}\right ) & \text {for}\: f = 0 \wedge m = 0 \\\frac {\left (d + e\right ) \left (\begin {cases} \frac {a^{2} \log {\left (c x^{n} \right )} + a b \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} \log {\left (c x^{n} \right )}^{3}}{3}}{n} & \text {for}\: n \neq 0 \\\left (a^{2} + 2 a b \log {\left (c \right )} + b^{2} \log {\left (c \right )}^{2}\right ) \log {\left (x \right )} & \text {otherwise} \end {cases}\right )}{f} & \text {for}\: m = 0 \\0^{m - 1} \left (\frac {a^{2} d m^{3} x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {3 a^{2} d m^{2} x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {3 a^{2} d m x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {a^{2} d x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {a^{2} e m^{2} x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 a^{2} e m x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {a^{2} e x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 a b d m^{3} n x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 a b d m^{3} x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {6 a b d m^{2} n x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {6 a b d m^{2} x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {6 a b d m n x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {6 a b d m x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 a b d n x}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 a b d x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 a b e m^{2} x x^{m} \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 a b e m n x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {4 a b e m x x^{m} \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 a b e n x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 a b e x x^{m} \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} d m^{3} n^{2} x}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 b^{2} d m^{3} n x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {b^{2} d m^{3} x \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {6 b^{2} d m^{2} n^{2} x}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {6 b^{2} d m^{2} n x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {3 b^{2} d m^{2} x \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {6 b^{2} d m n^{2} x}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {6 b^{2} d m n x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {3 b^{2} d m x \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} d n^{2} x}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 b^{2} d n x \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {b^{2} d x \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {b^{2} e m^{2} x x^{m} \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 b^{2} e m n x x^{m} \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} e m x x^{m} \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} e n^{2} x x^{m}}{m^{3} + 3 m^{2} + 3 m + 1} - \frac {2 b^{2} e n x x^{m} \log {\left (c x^{n} \right )}}{m^{3} + 3 m^{2} + 3 m + 1} + \frac {b^{2} e x x^{m} \log {\left (c x^{n} \right )}^{2}}{m^{3} + 3 m^{2} + 3 m + 1}\right ) & \text {for}\: f = 0 \\\frac {a^{2} d \left (f x\right )^{m}}{f m} + \frac {a^{2} e x^{m} \left (f x\right )^{m}}{2 f m} + \frac {2 a b d \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{f m} - \frac {2 a b d n \left (f x\right )^{m}}{f m^{2}} + \frac {a b e x^{m} \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{f m} - \frac {a b e n x^{m} \left (f x\right )^{m}}{2 f m^{2}} + \frac {b^{2} d \left (f x\right )^{m} \log {\left (c x^{n} \right )}^{2}}{f m} - \frac {2 b^{2} d n \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{f m^{2}} + \frac {2 b^{2} d n^{2} \left (f x\right )^{m}}{f m^{3}} + \frac {b^{2} e x^{m} \left (f x\right )^{m} \log {\left (c x^{n} \right )}^{2}}{2 f m} - \frac {b^{2} e n x^{m} \left (f x\right )^{m} \log {\left (c x^{n} \right )}}{2 f m^{2}} + \frac {b^{2} e n^{2} x^{m} \left (f x\right )^{m}}{4 f m^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 445 vs.
\(2 (218) = 436\).
time = 8.65, size = 445, normalized size = 1.97 \begin {gather*} \frac {b^{2} d f^{m} n^{2} x^{m} \log \left (x\right )^{2}}{f m} + \frac {b^{2} f^{m} n^{2} x^{2 \, m} e \log \left (x\right )^{2}}{2 \, f m} + \frac {2 \, b^{2} d f^{m} n x^{m} \log \left (c\right ) \log \left (x\right )}{f m} + \frac {b^{2} f^{m} n x^{2 \, m} e \log \left (c\right ) \log \left (x\right )}{f m} + \frac {b^{2} d f^{m} x^{m} \log \left (c\right )^{2}}{f m} + \frac {b^{2} f^{m} x^{2 \, m} e \log \left (c\right )^{2}}{2 \, f m} + \frac {2 \, a b d f^{m} n x^{m} \log \left (x\right )}{f m} - \frac {2 \, b^{2} d f^{m} n^{2} x^{m} \log \left (x\right )}{f m^{2}} + \frac {a b f^{m} n x^{2 \, m} e \log \left (x\right )}{f m} - \frac {b^{2} f^{m} n^{2} x^{2 \, m} e \log \left (x\right )}{2 \, f m^{2}} + \frac {2 \, a b d f^{m} x^{m} \log \left (c\right )}{f m} - \frac {2 \, b^{2} d f^{m} n x^{m} \log \left (c\right )}{f m^{2}} + \frac {a b f^{m} x^{2 \, m} e \log \left (c\right )}{f m} - \frac {b^{2} f^{m} n x^{2 \, m} e \log \left (c\right )}{2 \, f m^{2}} + \frac {a^{2} d f^{m} x^{m}}{f m} - \frac {2 \, a b d f^{m} n x^{m}}{f m^{2}} + \frac {2 \, b^{2} d f^{m} n^{2} x^{m}}{f m^{3}} + \frac {a^{2} f^{m} x^{2 \, m} e}{2 \, f m} - \frac {a b f^{m} n x^{2 \, m} e}{2 \, f m^{2}} + \frac {b^{2} f^{m} n^{2} x^{2 \, m} e}{4 \, f m^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (f\,x\right )}^{m-1}\,\left (d+e\,x^m\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________